import os
import datetime
import my_python_tool.core
import pkg.encryption.aes


if __name__ == "__main__":
    # my_python_tool.core.excel_to_pdf_and_img()
    # pkg.encryption.aes.AESCipher.createKeyAndIv(5)
    # print(datetime.datetime.now())
    # {"items":"[{\"ClientIp\":\"\",\"app_code\":\"fruitsmerge\",\"balance\":0.0,\"country_code\":\"EN\",\"event\":\"app_startup\",\"game_level\":0,\"hour\":13,\"os_type\":\"android\",\"register_date\":\"\",\"register_time\":0,\"request_time\":1739336518,\"user_id\":\"\",\"user_level\":1,\"vc\":104,\"vn\":\"1.0.4\"},{\"ClientIp\":\"\",\"app_code\":\"fruitsmerge\",\"balance\":0.0,\"country_code\":\"EN\",\"event\":\"inters_req\",\"game_level\":0,\"hour\":13,\"os_type\":\"android\",\"register_date\":\"\",\"register_time\":0,\"request_time\":1739336522,\"user_id\":\"\",\"user_level\":1,\"vc\":104,\"vn\":\"1.0.4\"},{\"ClientIp\":\"\",\"app_code\":\"fruitsmerge\",\"balance\":0.0,\"country_code\":\"EN\",\"event\":\"reward_request\",\"game_level\":0,\"hour\":13,\"os_type\":\"android\",\"register_date\":\"\",\"register_time\":0,\"request_time\":1739336522,\"user_id\":\"\",\"user_level\":1,\"vc\":104,\"vn\":\"1.0.4\"}]"}
    key = "BD3A6DE43FF080A512A00AE7B036134092A0600D1FAF0BF641183F95D4EEC001"
    # 获取字节key
    key = bytes.fromhex(key)
    iv = "8DA8F20226552F19F907767B3529C001"
    # 获取字节iv
    iv = bytes.fromhex(iv)

    str = "{\"adb\": true, \"android_id\": \"827f152116b794a1\", \"boot_time\": 403476009, \"brand\": \"OPPO\", \"country_code\": \"br\", \"de_height\": 2158, \"de_version\": \"12\", \"de_width\": 1080, \"deepLinkUrl\": \"\", \"density\": \"3.0\", \"ggClickTime\": 0, \"google_id\": \"\", \"hour\": 15, \"is_vpn\": false, \"language\": \"PT\", \"mac\": \"\", \"model\": \"PEHM00\", \"network\": \"\", \"oaid\": \"\", \"os_rom\": \"oppounknown\", \"os_type\": \"android\", \"request_time\": 1736755054, \"sim\": true, \"timezone_offset\": 28800, \"user_id\": \"\", \"vc\": 100, \"vn\": \"1.0.0\", \"wifi_mac\": \"\", \"wifi_name\": \"\", \"wifi_proxy\": false }"
    cipher = pkg.encryption.aes.AESCipher(key, iv)
    enData = cipher.encrypt_from_str(str)
    # enData = "RxrkWosjoVDNcqzGC8CBmkNQv6kdLs9jZs/mlTbaWc6el2KLzX79d9AS8u9Vz6Ir6yRR5OoVSzAB8HjyGqOOm1d1zhvJoZ1bUlGXkQA5aPgp85QLCbENQdvXDQ/2TdcPFJrwPBRJqB+WAQN2LoLqflr8wv2mKKJ/eCJvqh/Wp9tBzU3bxh+hiRUyvtnFdymvTvyYkLcoW3VfyZ5S3HGfyRdcHzvASkICNyeeC0FB35O2/nuqsIshevTnqL8qMoFBibxcvpLtDQo7IiATNy72hbeKgFIduUmhyjoEPBAFXTlU5yYMkc6Ts07UXVZHxplArwXlB6ixCRFuKUQs7jCfcTeb3+TiHVfbK/5xU5/Ct+Am1Epj4LRCSui7zR8p3sgGvFMKkxH+EkPDzMeJx+JynU52/lJ+5DPsOujKicwdWCavgkqfP+Em0L+ALQeKC+apWGusAxRN/Q7SbIkEaYB259/Ms74HfqK7XwQbgJHhGOMuHaom7gnjJbxa33cYFzb8vLr6XXNkS5tnuuQNkQ9sUdGpQcrQAh1PK4EX0qEdr5mxI4onDtOTyMHeJjPBCbFivuAszLuCNJCKxFLgHnMDyzYJ9KZ4/jHHZI9Krc4pzQKHplvcfvh1QyIlBWbSb7XsA/RE7SePIqK5GfgGu44r/oX42V6zQCA5wMSK18vLSlQMyJE4OSOJNsSJUHPHnA9TwXO5V3uuBsDO14ZFyr+VNhkj7o4r7pjjFuDOunIWFW6owt4GkQI1aWgW7/8hvG2I/NwOF1eQqXpeDrex0B3hmedWBbf9+UA323Dq2CeXorToAcx7F3hurC3awVgPYLMkl8TKfye98uVjEXVZO89/LfQhX2WJBvPxgBtHvVac3gtl6dqoo5uMPfDdvRBxrHmnABVEr1KEFUZnDOeoq+B18MygbMPinkGWLt2smTyIttISnTGGgqRZ7z6PEI1LRCaqk85c6Sq59kjevOmeLny1uwj7x0tkUa1yEuYUYqkiQFF+2cxEJPyjvpwmFdjFeeUyqV82VEDU1Hagj085LnL+oJHq6xGL7JjRc0Gvt3GnnF066eP7Tnzefx5/tnaDwO0uElXCM59yUB7Jjk4BZ/2YOkuagWLEb4JFXLjUCr/MU5r6KZhLt/n/ST40gaYEpbM5HJKYdQphat+wr4xxXQ37+bDUuMuurABICII8uYynAgJIxEq4cDGH/q0jIZWYwYaDRDYnyyXK9sNTGMBvy7A+9x6NI8wW+tOt1u9xwk2pOjQgChDoVN62TV5xxt364taDUk0kJn2QSIqc6Epeb9cONnS4Jrnw1+yOuUVCNQswXHx4cU3DFSeHc3RYhXvCkHrras8/JjHJ/o58sG/2ppMjrjJoIn155/G3/MSB80HrYOEDuL/IZj450x7E97KtYrMNpsFQMUC/VEMbPBPBEih4J4IB4AelcMbRSQhtffrs64S7mMlrE+nPwRTXA4No"
    print(enData)
    deData = cipher.decrypt_to_str(enData)
    # bytes转字符串
    print(deData)